<div class="maintop">
    当前位置：用户银行管理
    <a href="javascript:;" action="<?=$basepath?>_add" class="mainFrame button icon-plus">添加</a>
    <a href="javascript:;" action="<?=$basepath?>?<?=$this->page_url($page_current,$page_url)?>" id="btn_refresh" class="mainFrame button">刷新</a>
    <? if(ISDEBUG){ ?>
        <a href="javascript:$('.debuginfo').toggle();" class="button">调试信息</a>
    <? } ?>
</div>
<div class="main-search">
    <table width="100%">

        <tbody><tr>
            <td>
                <form action="<?=$basepath?>" id="brandsSearch" method="get" target="ajax" dataType="html" onajax="beforeSearchForm" call="searchForm" container="#iframe" isLoad="true">
                    &nbsp;<select name="field">
                        <option value="">全部</option>
                        <option value="uno">玩家号码</option>
                    </select>
                    <select name="bankid">
                        <option value="">全部银行</option>
                        <? foreach ($banks as $bk=>$bv){
                            echo '<option value="'.$bk.'">'.$bv.'</option>';
                        }
                        ?>
                    </select>
                    <input type="text" id="sKey" name="sKey" class="int" placeholder="搜索关键字">
                    每页：
                    <select id="ps" name="ps">
                        <option value="12" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 12) echo 'selected';?> >12</option>
                        <option value="20" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 20) echo 'selected';?> >20</option>
                        <option value="30" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 30) echo 'selected';?> >30</option>
                        <option value="50" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 50) echo 'selected';?> >50</option>
                        <option value="100" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 100) echo 'selected';?> >100</option>
                    </select>
                    <input type="submit" value="搜索" class="upbutton">
                </form>
            </td>
        </tr>
        </tbody>

    </table>
</div>
<div id="mainbody">
    <table width="100%" class="tablist">
        <tr class="trbg">
            <th>No.</th>
            <th>玩家号码/昵称</th>
            <th>开户行</th>
            <th>帐号姓名</th>
            <th>帐号</th>
            <th>帐号地址</th>
            <th>状态</th>
            <th width="60">操作</th>
        </tr>
        <? foreach($datas as $v){ ?>
            <tr<?=($v['isdelete'] ? ' class="delete"' : '')?>>
                <td><?=$v['id']?></td>
                <td><?=$v['uno']?> - <?=$v['nickname']?></td>
                <td><?=$v['title']?></td>
                <td><?=$v['name']?></td>
                <td><?=$v['account']?></td>
                <td><?=$v['openadds']?></td>
                <td><a href="javascript:;" class="upbutton state<?=$v['state']?>"><?=($v['state']?'正常':'禁用')?></a></td>
                <td>
                    <a action="<?=$basepath?>_delete?id=<?=$v['id']?>" title="删除" class="mainFrame button icon-trash-2" href="javascript:;"></a>
                    <a action="<?=$basepath?>_edit?id=<?=$v['id']?>" title="编辑" class="mainFrame button icon-edit" href="javascript:;"></a>
                </td>
            </tr>
        <? } ?>
    </table>
    <? require VIEW.'/page.view.php' ?>
</div>
<script type="text/javascript">
    function beforeSearchForm(){
        var _key = this.sKey.value;
        if(_key.length<=0){
            //throw '搜索关键字不能为空';
        }
    }
    function searchForm(self, _html, data){
        $("#iframe").html(_html);
    }
    $(document).ready(function(){
        <?php
        if(!empty($searchdata['sKey'])){
            echo '$("#sKey").val("'.$searchdata['sKey'].'");';
        }
        if(!empty($searchdata['field'])){
            echo '$("select[name=\'field\'] option[value=\''.$searchdata['field'].'\']").attr("selected", "selected");';
        }
        if(!empty($searchdata['bankid'])){
            echo '$("select[name=\'bankid\'] option[value=\''.$searchdata['bankid'].'\']").attr("selected", "selected");';
        }
        ?>
        $(".colorbox").colorbox({ iframe: true,width:"80%",height:"80%" });
    });
</script>
